<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$user = pdo_fetchall("SELECT * FROM " . tablename('zh_gjhdbm_user') . " WHERE uniacid= :weid ORDER BY id DESC", array(':weid' => $_W['uniacid']), 'id');
$info=pdo_get('zh_gjhdbm_hx',array('id'=>$_GPC['id']));
if(checksubmit('submit')){
         $data['user_id']=0;       
        $data['hx_id']=$_GPC['user_id'];
        $data['time']=time();         
        $data['uniacid']=$_W['uniacid'];
     if($_GPC['id']==''){  
        $res=pdo_insert('zh_gjhdbm_hx',$data);
        if($res){
             message('添加成功！', $this->createWebUrl('hxlist'), 'success');
        }else{
             message('添加失败！','','error');
        }
    }else{
        $res=pdo_update('zh_gjhdbm_hx',$data,array('id'=>$_GPC['id']));
        if($res){
             message('编辑成功！', $this->createWebUrl('hxlist'), 'success');
        }else{
             message('编辑失败！','','error');
        }
    }
}

include $this->template('web/addhx');